package com.ticket.sass.provider.dto.input.film;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.List;

/**
 * @author ywb
 * @date 2024-03-28 16:56
 */
@Data
@ApiModel
public class FilmUpdInput {
    private Long id;
    
    @ApiModelProperty(value = "影片名")
    private String name;
    
    @ApiModelProperty(value = "影片封面")
    private String cover;
    
    @ApiModelProperty(value = "上映时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDate releaseDate;
    
    @ApiModelProperty(value = "上映地区")
    private String releaseArea;
    
    @ApiModelProperty(value = "导演")
    private String director;
    
    @ApiModelProperty(value = "主演员")
    private String[] actors;
    
    @ApiModelProperty(value = "类型")
    private String[] types;
    
    @ApiModelProperty(value = "片长")
    private Integer duration;
    
    @ApiModelProperty(value = "剧情描述")
    @TableField("\"desc\"")
    private String desc;
    
    @ApiModelProperty(value = "影片评分", example = "8.5")
    @DecimalMin(value = "0.0", inclusive = false, message = "评分不能小于0")
    @DecimalMax(value = "10.0", inclusive = true, message = "评分不能大于10")
    private BigDecimal score;
    
    @Valid
    @ApiModelProperty(value = "发行版本")
    private List<FilmVersionInput> versions;
    
}
